package com.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *流动站数据
 * </p>
 *
 * @author zhangqing
 * @since 2021/1/19
 */
@Data
public class Rover {

    private Long id;

   private Integer subid;//补充方便匹配网格点

    private Integer cellid;

    private Integer vrsid; //基站id

    private Double x;//网格点X

    private Double y;//网格点Y

    private Double z;//是否连接

    private Integer rovernum;//该网格点相关流动站数量

    private Integer satnum;//固定星数量

    private  List<OneRover> allrover;
    @Data
    @Document(indexName = "rover",shards = 1,replicas = 0)
    public static class OneRover {

        @Id
        @Field
        private String id;
        @ApiModelProperty("ntrip账号")
        private String ntripname;//ntrip账号
        @Field
        @ApiModelProperty("挂载点")
        private  String mountpiont;//挂载点
        @Field
        @ApiModelProperty("用户标识 ")
        private String username;//用户标识（如果传过来的是空值，就按规则生成个设备名称，如设备1、设备2）
        @Field
        @ApiModelProperty("本次流动站的登陆时间")
        private String time;//本次该流动站登录时间
        @Field
        @ApiModelProperty("gpgga协议字符 ")
        private String GPGGA;//该流动站gpggagpgga协议解读https://www.jianshu.com/p/2e64f3201e16

        @Field
        @ApiModelProperty("子网")
        private Integer subid;
        @Field
        @ApiModelProperty("小区")
        private Integer cellid;
        @Field
        @ApiModelProperty("网格点")
        private Integer vrsid; //基站id
        @ApiModelProperty("流动站gpgga时间")
        @Field(type = FieldType.Auto)
        private Date gpggaDate;
        @ApiModelProperty("纬度")
        @Field
        private String latitude;
        @ApiModelProperty("经度")
        @Field
        private String longitude;
        @Field(type = FieldType.Auto)
        @ApiModelProperty("本次流动站的登陆时间")
        private Date loginDate;
    }

}
